<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	version="1.0">

	<xsl:template match="/canss">
		<html>
			<body>
				<h1>Content Description List</h1>
				<xsl:template match="canssContent_mediaGroup">
					<table class="datatable">
						<tbody>
							<th scope='col'><center>No.</center></th>
							<th scope='col'><center>Title</center></th>
							<th scope='col'><center>Thumbnail</center></th>
							<th scope='col'><center>Play Button</center></th>
							<th scope='col'><center>Uploaded Time</center></th>
							<th scope='col'><center>Owner</center></th>
							<th scope='col'><center>Status</center></th>
							<th scope='col'><center>Content Publish</center></th>
							<th scope='col'><center>Usages</center></th>
							
							<xsl:for-each
								select="/canss/canssContent_mediaGroup/canssContent_media">
								<tr>
									<td scope='col'>
										<center>
											<xsl:number format="1" />
										</center>
									</td>
									<td>
										<xsl:variable
											name="v_dc_description" select="dc_description" />
										<p title="{$v_dc_description}">
											<xsl:value-of select="dc_title" />
											<span style="color:#ffffff"><br/><xsl:value-of select="canssContentDescription_contentId" /></span>
										</p>
									</td>
									<td class="singleentry">
										<xsl:variable name="v_thumbnail"
											select="canssContent_Thumbnail" />
										<xsl:if
											test="true()=canssContent_Thumbnail/text()">
											<a href="{$v_thumbnail}"
												target="_blank">
												<img src="{$v_thumbnail}" class="thumbnail" />
											</a>
										</xsl:if>
										<xsl:if
											test="true()!=canssContent_Thumbnail/text()">
											-
										</xsl:if>
									</td>
									<td class="singleentry">
										<xsl:variable name="v_src"
											select="xmp_Identifier" />
										<xsl:variable name="v_Thumbnail"
											select="canssContent_Thumbnail" />
										<xsl:if
											test="true()=xmp_Identifier/text()">
											<xsl:choose>
												<xsl:when
													test="canssContentDescription_status='277'">
													<a
														onclick="window.open('testplayer/content_testview.jsp?_src={$v_src}&amp;_image={$v_Thumbnail}', 'pop_view_player', 'width=380,height=360');"
														href="#">
														<img
															src="design/img/t_play.png" width="30" height="30" />
													</a>
												</xsl:when>
												<xsl:when
													test="canssContentDescription_status='300'">
													<a
														onclick="window.open('testplayer/content_testview.jsp?_src={$v_src}&amp;_image={$v_Thumbnail}', 'pop_view_player', 'width=380,height=360');"
														href="#">
														<img
															src="design/img/t_play.png" width="30" height="30" />
													</a>
												</xsl:when>
												<xsl:when
													test="canssContentDescription_status='310'">
													<a
														onclick="window.open('testplayer/content_testview.jsp?_src={$v_src}&amp;_image={$v_Thumbnail}', 'pop_view_player', 'width=380,height=360');"
														href="#">
														<img
															src="design/img/t_play.png" width="30" height="30" />
													</a>
												</xsl:when>
												<xsl:otherwise>
													-
												</xsl:otherwise>
											</xsl:choose>
										</xsl:if>
									</td>
									<td>
										<xsl:value-of
											select="xmpdm_Moddate" />
									</td>
									<td class="singleentry">
										<xsl:value-of
											select="canssContentDescription_owner" />
									</td>
									<td>
										<xsl:if
											test="true()=canssContentDescription_statusdesc/text()">
											<xsl:variable name="v_cid"
												select="canssContentDescription_contentId" />
											<div
												id="div_statusdesc_{$v_cid}" style='cursor:pointer'
												onmouseover="this.style.color='red'"
												onmouseout="this.style.color=''"
												onclick="load_cidstatus_obj('div_statusdesc_', '{$v_cid}', '1', '4')">
												<xsl:value-of
													select="canssContentDescription_statusdesc" />
											</div>
										</xsl:if>
										<xsl:if
											test="true()!=canssContentDescription_statusdesc/text()">
											<xsl:value-of
												select="canssContentDescription_status" />
										</xsl:if>
									</td>
									<td class="singleentry">
										<xsl:variable name="v_cid"
											select="canssContentDescription_contentId" />
										<xsl:variable name="v_js_submit" select="js_submit" />
										<div
											id="div_{$v_cid}">
											<xsl:choose>
												<xsl:when
													test="canssContentDescription_status='100'">
													<form method="post"
														action="svtAjaxContentStatusUpdate">
														<input type='hidden' name="_ajax" value="admin"/>
														<input type='hidden'
															name="_cid" value="{$v_cid}" />
														<input type='hidden'
															name="_status" value="330" />
														<input type='hidden'
															name="_rurl" value="mainframe.jsp?_pagenum=4" />
														<input type="button"	onclick="{$v_js_submit}"
															value="삭제" />
													</form>
												</xsl:when>
												<xsl:when
													test="canssContentDescription_status='277'">
													<form method="post"
														action="svtAjaxContentStatusUpdate">
														<input type='hidden' name="_ajax" value="admin"/>
														<input type='hidden'
															name="_cid" value="{$v_cid}" />
														<input type='hidden'
															name="_status" value="320" />
														<input type='hidden'
															name="_rurl" value="mainframe.jsp?_pagenum=4" />
														<input type="button"	onclick="{$v_js_submit}"
															value="컨텐츠 차단" />
													</form>
												</xsl:when>
												<xsl:when
													test="canssContentDescription_status='299'">
													<form method="post"
														action="svtAjaxContentStatusUpdate">
														<input type='hidden' name="_ajax" value="admin"/>
														<input type='hidden'
															name="_cid" value="{$v_cid}" />
														<input type='hidden'
															name="_status" value="330" />
														<input type='hidden'
															name="_rurl" value="mainframe.jsp?_pagenum=4" />
														<input type="button"	onclick="{$v_js_submit}"
															value="삭제" />
													</form>
												</xsl:when>
												<xsl:when
													test="canssContentDescription_status='300'">
													<form method="post"
														action="svtAjaxContentStatusUpdate">
														<input type='hidden' name="_ajax" value="admin"/>
														<input type='hidden'
															name="_cid" value="{$v_cid}" />
														<input type='hidden'
															name="_status" value="320" />
														<input type='hidden'
															name="_rurl" value="mainframe.jsp?_pagenum=4" />
														<input type="button"	onclick="{$v_js_submit}"
															value="컨텐츠 차단" />
													</form>
												</xsl:when>
	
												<xsl:when
													test="canssContentDescription_status='310'">
													<form method="post"
														action="svtAjaxContentStatusUpdate">
														<input type='hidden' name="_ajax" value="admin"/>
														<input type='hidden'
															name="_cid" value="{$v_cid}" />
														<input type='hidden'
															name="_status" value="320" />
														<input type='hidden'
															name="_rurl" value="mainframe.jsp?_pagenum=4" />
														<input type="button"	onclick="{$v_js_submit}"
															value="컨텐츠 차단" />
													</form>
												</xsl:when>
	
												<xsl:when
													test="canssContentDescription_status='320'">
													<form method="post"
														action="svtAjaxContentStatusUpdate">
														<input type='hidden' name="_ajax" value="admin"/>
														<input type='hidden'
															name="_cid" value="{$v_cid}" />
														<input type='hidden'
															name="_status" value="300" />
														<input type='hidden'
															name="_rurl" value="mainframe.jsp?_pagenum=4" />
														<input type="button"	onclick="{$v_js_submit}"
															value="차단 해제" />
													</form>
													<form method="post"
														action="svtAjaxContentStatusUpdate">
														<input type='hidden' name="_ajax" value="admin"/>
														<input type='hidden'
															name="_cid" value="{$v_cid}" />
														<input type='hidden'
															name="_status" value="330" />
														<input type='hidden'
															name="_rurl" value="mainframe.jsp?_pagenum=4" />
														<input type="button"	onclick="{$v_js_submit}"
															value="삭제" />
													</form>
												</xsl:when>
	
												<xsl:when
													test="canssContentDescription_status='330'">
													-삭제됨-
													<form method="post"
														action="svtAjaxContentStatusUpdate">
														<input type='hidden' name="_ajax" value="admin"/>
														<input type='hidden'
															name="_cid" value="{$v_cid}" />
														<input type='hidden'
															name="_status" value="340" />
														<input type='hidden'
															name="_rurl" value="mainframe.jsp?_pagenum=4" />
														<input type="button"	onclick="{$v_js_submit}"
															value="재 업로드 요청" />
													</form>
													<form method="post"
														action="http://mediator.canss.net/DatabaseManager/DeleteContent.php">
														<input type='hidden' name="_ajax" value="admin"/>
														<input type='hidden'
															name="CID" value="{$v_cid}" />
														<input type='hidden'
															name="DELCONTENT" value="1" />
														<input type='hidden'
															name="_rurl" value="mainframe.jsp?_pagenum=4" />
														<input type="button"	onclick="{$v_js_submit}"
															value="완전 삭제" />
													</form>
												</xsl:when>
												<xsl:when
													test="canssContentDescription_status='340'">
													재 업로드 대기
												</xsl:when>
												<xsl:otherwise>
													사용 불가
												</xsl:otherwise>
											</xsl:choose>
										</div>
									</td>
	
									<td>
										<xsl:if
											test="true()=canssContentDescription_3rdlist/text()">
											<xsl:variable name="v_3rdlist"
												select="canssContentDescription_3rdlist" />
											<p title="{$v_3rdlist}">
												<b>O</b>
											</p>
										</xsl:if>
										<xsl:if
											test="true()!=canssContentDescription_3rdlist/text()">
											<p>X</p>
										</xsl:if>
									</td>
								</tr>
							</xsl:for-each>
						</tbody>
					</table>
				</xsl:template>
				<!-- 
					<xsl:template match="canssDebug">
					<xsl:for-each select="//msg">
					<xsl:value-of select="text()"/><br/>
					</xsl:for-each>
					</xsl:template>
				-->
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>